package com.imooc.servlet;

import java.io.IOException;
import java.util.List;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import com.imooc.beans.Message;
import com.imooc.service.MaintainService;
import com.imooc.service.MessageService;

public class deleteBatchServlet extends HttpServlet{

	@Override
	protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
		
		req.setCharacterEncoding("utf-8");
		String[] ids=req.getParameterValues("id");
		
		String command = (String) req.getParameter("command");
		String description = (String) req.getParameter("description");
		req.setAttribute("command", command);
		req.setAttribute("description", description);
		
		
		MaintainService maintainService= new MaintainService();
		maintainService.deleteBatch(ids);
		
		
		
		
		req.getRequestDispatcher("List.action").forward(req, resp);
		
	}
	
	@Override
	protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {

		
		
		this.doGet(req, resp);
	}
	
}
